diff options
Diffstat (limited to 'cfg/fish_prompt[s].fish')
| -rw-r--r-- | cfg/fish_prompt[s].fish | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/cfg/fish_prompt[s].fish b/cfg/fish_prompt[s].fish index af447ce..da0903a 100644 --- a/cfg/fish_prompt[s].fish +++ b/cfg/fish_prompt[s].fish @@ -1,17 +1,27 @@ # fish_prompt function fish_prompt - set -l user (set_color green)$USER(set_color white)"@" + set -l user $USER set -l cwd $PWD set -l home $HOME if test "$cwd" = "$home" - echo -e (set_color white)"("(set_color green)"$user"(set_color magenta)"~"(set_color white)")"(set_color normal)"\n⮞ " + # if in ~ + echo -e (set_color red)"("(set_color white)"$user" \ + (set_color red)"⮞"(set_color white)"⮞"(set_color red)"⮞" \ + (set_color white)"~"(set_color red)")"(set_color normal)"\n⮞ " + # (max⮞⮞⮞~) + # ⮞ else if string match -q "$home/*" $cwd set -l relative (string replace "$home/" "~/" $cwd) - echo -e (set_color white)"("(set_color green)"$user"(set_color magenta)$relative(set_color white)")"(set_color normal)"\n⮞ " - #echo -e "$user"(set_color green)$relative(set_color white)" => " + # if in a ~ subdir + echo -e (set_color red)"("(set_color white)"$user" \ + (set_color red)"⮞"(set_color white)"⮞"(set_color red)"⮞" \ + (set_color white)$relative(set_color red)")"(set_color normal)"\n⮞ " else - echo -e "$user"(set_color green)$cwd(set_color white)" => " + # if in any other dir + echo -e (set_color red)"("(set_color white)"$user" \ + (set_color red)"⮞"(set_color white)"⮞"(set_color red)"⮞" \ + (set_color white)$cwd(set_color red)")"(set_color normal)"\n⮞ " end end @@ -21,14 +31,20 @@ function fish_right_prompt # check for which color to use if test $last_status -eq 0 - set color green + set color white else set color red end + if test $color = "white" + set colorInverse red + else + set color white + end + # set date in dt set dt $(date '+%Y-%m-%d %H:%M') # print prompt - echo -e (set_color white)"( "(set_color $color)"$last_status"(set_color white)" | "(set_color $color)"$dt"(set_color white)" )" + echo -e (set_color $colorInverse)"( "(set_color $color)"$last_status"(set_color white)" | "(set_color $color)"$dt"(set_color $colorInverse)" )" end |